Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KCL stdlib and circle function #1029

Merged
merged 6 commits into from
Nov 9, 2023
Merged

KCL stdlib and circle function #1029

merged 6 commits into from
Nov 9, 2023

Conversation

adamchalmers
Copy link
Collaborator

@adamchalmers adamchalmers commented Nov 8, 2023

Allows stdlib functions to be written as KCL, not as Rust. Rust stdlib functions will hereafter be referred to as "core" not "std".

kcl-stdlib.mp4

Right now the only stdlib function I implemented is a circle function (it's a wrapper around the core arc function which sets the arc's start/end to 0 and 360 respectively). I know I want to change this function as soon as KCL has enums, which is my next task. So, I don't want users to start using this right away. To that end, I've named this function "unstable_stdlib_circle" not "circle". Once the function is ready to be stabilized, I can rename it to just "circle".

Note that this PR modifies the existing "sketch and extrude a cylinder" KCL test so that instead of using a user-defined circle function, it uses the unstable_stdlib_circle function now. And the twenty-twenty tests pass, so we know my stdlib is working 🎉

Fixes #922

Copy link

vercel bot commented Nov 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Nov 9, 2023 4:27am

}

fn std_lib_fn(&self) -> crate::std::StdFn {
todo!()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jessfraz this is bad but I don't know what to do here. How is this method actually used for the docs?

@adamchalmers adamchalmers changed the title KCL stdlib KCL stdlib and circle function Nov 9, 2023
Copy link
Collaborator

@Irev-Dev Irev-Dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this is mostly beyond me, so don't have much input.

@adamchalmers adamchalmers merged commit b925ed9 into main Nov 9, 2023
16 checks passed
@adamchalmers adamchalmers deleted the achalmers/core-vs-std branch November 9, 2023 15:58
@pierremtb pierremtb mentioned this pull request Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have a standard library (not core)
2 participants